{{define "content"}}
    <div id="main">
        
        <!-- 面包屑导航 -->
        <div id="bread" class="box list sky-blue">
            <span class="left">
                <a href="/">{{.Gobbs.title}}</a>
				   <img src="/images/divider.gif" /> {{.ForumRoot.Name}}
				   <img src="/images/divider.gif" /> <a href="#">{{.Forum.Name}}</a>

                <a href="#"><img class="rss" src="/images/xml.gif" /></a>
            </span>
            <span class="right">[<a href="#">申请版主</a>] <em class="gray">版主:</em> 
				{{range $key, $value := .Forum.Moderators}}
                 &nbsp;<a href="/user/{{$key}}">{{$value}}</a>
				{{end}}</span>
        </div>

        <!-- 热门标签 -->
        <!--
        <div id="hottags" class="box list">
            <h4 class="sky-blue"><strong>热门标签</strong></h4>
            <p class="sky-blue">
                <a href="search.php?keyword=PHP">PHP</a>
                <a href="search.php?keyword=JAVA">JAVA</a>
                <a href="search.php?keyword=CSS">CSS</a>
                <a href="search.php?keyword=C">C</a>
            </p>
        </div>
		-->
        <!-- 帖子分类 -->
        <div class="pagebar">
            <div class="left">
                <p class="post_btn2">
                    <a {{if eq .Act ""}}class="on"{{end}} href="/forum/{{.Forum.Fid}}">最新帖</a>
                    <a {{if eq .Act "price"}}class="on"{{end}} href="/forum/{{.Forum.Fid}}?act=price">悬赏帖</a>
                    <a {{if eq .Act "hot"}}class="on"{{end}} href="/forum/{{.Forum.Fid}}?act=hot">热点区</a>
                    <a {{if eq .Act "pith"}}class="on"{{end}} href="/forum/{{.Forum.Fid}}?act=pith">精华区</a>
                    <a {{if eq .Act "moder"}}class="on"{{end}}  href="/forum/{{.Forum.Fid}}?act=moder">版主管理</a>
                </p>
            </div>
            <div class="right">
                <p class="post_btn"><a href="/forum/post?fid={{.Forum.Fid}}">发表新帖</a></p>
            </div>
        </div>

<form method="post" name="form1" action="/admin">
        <!-- 论坛帖子列表 -->
        <div class="list">
            <h1 class="block_sub">{{.Forum.Name}}</h1>
            <div class="list_table mainbox">
                <table>
                    <thead>
                        <tr>
                            <td class="folder">&nbsp;</td>
                            <th class="subject">主题</th>
                            <td class="author">作者</td>
                            <td class="nums">阅读/跟帖</td>
                            <td class="lastpost">最后发表</td>
                        </tr>
                    </thead>
                    {{$CheckIsAdmin := .CheckIsAdmin}}
					{{range .ThreadList}}
                    <tbody>
                        <tr onmouseover="hover(this);" onmouseout="out(this);">
                            <td class="folder"><a href="/t/{{TplObjectID .Tid}}" target="_blank">
                            
							  {{ if eq .Type "order" }}
							    {{if eq .Islock 1 }}
							      <img src="/images/thread/tradelock.gif" />
								{{else}}
							      <img src="/images/thread/trade.gif" />
								{{end}}
							  {{else}}
								  {{ if eq .Type "ask" }}
								    {{if eq .Islock 1 }}
								      <img src="/images/thread/rewardlock.gif" />
									{{else}}
								      <img src="/images/thread/reward.gif" />
									{{end}}
								  {{else}}
									  {{if eq .Islock 1 }}
									    <img src="/images/thread/topiclock.gif" />
									  {{else}}
										  {{if gre .Replies 9 }}
										    <img src="/images/thread/topichot.gif" />
										  {{else}}
										    <img src="/images/thread/topicnew.gif" />
										  {{end}}
									  {{end}}
								  {{end}}
							  {{end}}
							  </a></td>
                            <th class="subject"><h2>
							  {{if eq $CheckIsAdmin 1 }}
							    <INPUT TYPE="checkbox" NAME="checkId[]" value="{*$item->tid*}">
							  {{end}}
							  {{if eq .Ispith 1 }}<span class="red">[精华]</span>{{end}}
							  {{if gre .Icon 1}}
							    <span class="icon"><img src="/images/icon/{{.Icon}}.gif" border="0" alt=""></span>
							  {{end}}
							  <a title="{{.Subject}}" href="/t/{{TplObjectID .Tid}}" >{{.Subject}}</a> 
							  {{if neq .Attachment "" }}
							    <img src="/images/file/{{.Attachment}}.gif"  border="0" alt="" align="absmiddle" >
							  {{end}}
							  {{if eq .Type "order" }}<span class="blue">- [售价 {{.Readorder}} 积分]</span>{{end}}
							  {{if eq .Type "ask" }}<span class="orange">- [悬赏 {{.Askprice}} 积分{{ if eq .Askstate 1 }}，已解决{{end}}]</span>{{end}}
							  {{if eq .Type "level" }}<span class="green">- [阅读权限 {{.Readlevel}} ]</span>{{end}}
								&nbsp;{{if gre .Flower 0}}鲜花(<span class="orange">{{.Flower}}</span>){{end}}
								      {{if gre .Egg 0}}鸡蛋(<span class="orange">{{.Egg}}</span>){{end}}
							  </h2></th>
							  
                            <td class="author">
                                {{if eq .Isanonymous 0}}<a href="/user/{{.Userid }}" >{{.Username}}</a>{{else}}匿名{{end}}
                                <em class="time">{{TplObjectTime .Tid ""}}</em>
                            </td>
                            <td class="nums"><em>{{.Views}}</em>/{{.Replies}}</td>
                            <td class="lastpost">
							{{if neq .Lastusername ""}}
                                <a href="/user/{{.Lastuserid }}">{{.Lastusername }}</a>
                                <em class="time">{{TplTime .Lasttime ""}}</em>

							{{else}}
							-
							{{end}}
                            </td>
                        </tr>
                    </tbody>
					{{else}}
					<tbody>
						<tr>
							<td colspan="5" align="center">
								暂无主题
							</td>
						</td>
					</tr>
					{{end}}
                </table>
            </div>
        </div>
        <!-- 帖子分类 -->
        <div class="list">
            <div class="right">
                <p class="post_btn"><a href="post.php?fid={*$fid*}">发表新帖</a></p>
            </div>
            <div class="left">
                <p class="post_page">
                   {{with .ThreadNum}}
                   {{.List}}
                   {{end}}
                </p>
            </div>
        </div>
        <!-- 管理菜单 -->
		{{if eq .CheckIsAdmin 1 }}
        <div id="admin_func" class="box list sky-blue">
            <p>
			    <input type="hidden" name="fid" value="{*$fid*}">
                <input class="submit" type="button" value="批量删帖" name="act" onclick="doActions('form1','/admin?act=delete')"/>
                <input class="submit" type="button" value="置顶帖子" name="act" onclick="doActions('form1','/admin?act=top')"/>
                <input class="submit" type="button" value="移动帖子" name="act" onclick="doActions('form1','/admin?act=move')"/>
                <input class="submit" type="button" value="提前主题" name="act" onclick="doActions('form1','/admin?act=up')"/>
                <input class="submit" type="button" value="加亮主题" name="act" onclick="doActions('form1','/admin?act=light')"/>
                <input class="submit" type="button" value="设置精华" name="act" onclick="doActions('form1','/admin?act=pith')"/>
                <input class="submit" type="button" value="锁定帖子" name="act" 
				onclick="doActions('form1','/admin?act=lock')"/>
            </p>
        </div>
		{{end}}
        </form>


        <!-- 版块分类 -->
        <div class="legend list">
            <label><img src="/images/thread/topicnew.gif" />新主题</label>
            <label><img src="/images/thread/topichot.gif" />热门主题</label>
            <label><img src="/images/thread/topiclock.gif" />锁定主题</label>
            <label><img src="/images/thread/reward.gif" />悬赏主题</label>
            <label><img src="/images/thread/trade.gif" />出售主题</label>
        </div>
        
    </div>

{{end}}

